1 //------------------------------------------------------------------------
3 // Copyright (c) Microsoft Corporation. All rights reserved.
6 // Defines a list convenience class, for use with a small number of
10 // 2005/06/19 - [....]
13 // Ported Windows->DevDiv. See SourcesHistory.txt.
15 //------------------------------------------------------------------------
19 #ifndef STRINGMAP_HXX_INCLUDED
20 #define STRINGMAP_HXX_INCLUDED
23 #include "miscmacros.hxx"
32 CStringMapNode(CStringMapNode
* pNext
, LPCWSTR key
, T tValue
)
39 T
GetValue() { return m_tValue
; }
40 CStringMapNode
* GetNext() { return m_pNext
; }
45 CStringMapNode
* m_pNext
;
57 CStringMapNode
* pNode
= m_pRoot
;
61 CStringMapNode
* pNext
= pNode
->GetNext();
68 HRESULT
Add(LPCWSTR pwzKey
, T tValue
)
77 m_pRoot
= new CStringMapNode(m_pRoot
, pwzKey
, tValue
);
85 HRESULT
Find(LPCWSTR pwzKey
, T
* ptValue
)
89 CStringMapNode
* pNode
= m_pRoot
;
93 if (_wcsicmp(pwzKey
, pNode
->GetKey()) == 0)
95 *ptValue
= pNode
->GetValue();
99 pNode
= pNode
->GetNext();
111 CStringMapNode
* GetRoot() { return m_pRoot
; }
113 DWORD
GetCount() { return m_dwCount
; }
116 CStringMapNode
* m_pRoot
;
120 #endif //STRINGMAP_HXX_INCLUDED